<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class pro_lap_konfirmasi_tagihan extends MY_Controller {
	
	function __construct()
	{
		parent::__construct(); 
		
		$this->load->model('pro_lap_konfirmasi_tagihan_model', 'LapKonfirmasiTagihan');
		$this->secure_session();
	}
	
	function cetak(){
		$trigger		= get('trigger');
		$data_explode	= explode(',', $trigger);
			
			// Load FPDF
			$this->load->helper('fpdf');
			
			// Set Data
			$data['data']					= $this->LapKonfirmasiTagihan->GetCetak($trigger);
			$data['data_detail_sewa']		= $this->LapKonfirmasiTagihan->GetDetailSewa($trigger);
			$data['data_detail_listrik']	= $this->LapKonfirmasiTagihan->GetDetailListrik($trigger);
			$data['no_konfirmasi']			= $data_explode[0];
			// Load View
			$this->load->view('pro_lap_konfirmasi_tagihan/cetak', $data);
			
	}
	function index(){
		$data['title'] = "Laporan Konfirmasi Tagihan Sewa Dan Listrik";

		$bulan = date("m");
		$tahun = date("Y");
			
			$hasil = "";
			$iromawi =
			array("","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII");
			if(array_key_exists($bulan,$iromawi)){
				$hasil = $iromawi[$bulan];
			}

		$data['no_konfirmasi'] ="PN.01.00/"."____/". $hasil . "/" . $tahun;
		viewByTemplate('pro_lap_konfirmasi_tagihan/index', $data, 'grid');
	}

	
	
	function getdata()
	{
		$this->secure_session();
		echo $this->LapKonfirmasiTagihan->GetJSON();
	}
}
?>